#include "NamedPipe.hpp"
#include "Shm.hpp"
int main()
{
    Shm shm(pathname, gCreater, gProc_id);

    char *shmaddr = (char *)shm.AddrShm();
    // 打开管道
    NamedPipe fifo(path, gCreater);
    fifo.OpenForRead();
    while (true)
    {
        std::string tmp;
        int n=fifo.ReadNamePipe(&tmp);
        if(n==0)
        {
            std::cout<<"read over "<<std::endl;
            break;
        }
        else if(n<0)
        {
            std::cout<<" read error"<<std::endl;
            break;
        }
        std::cout << shmaddr << std::endl;
    }
    return 0;
}